<html>
<head><meta charset="utf-8"><title>future incompat report · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html">future incompat report</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240675221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240675221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240675221">(May 29 2021 at 00:58)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> I am looking at moving future-incompat-report forward towards stabilization, and I was wondering if the JSON interface could be simplified.  Is there a reason that the diagnostics are collected and then emitted all at once instead of emitting them as they are encountered?  I'm thinking it would simplify the JSON interface to just emit a normal diagnostic structure that has an extra field with the future-incompat status.  This could also make it safer to enable it for non-cargo users.</p>



<a name="240705229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705229">(May 29 2021 at 14:37)</a>:</h4>
<p>Originally, I did have the diagnostic info being emitted as it occured</p>



<a name="240705240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705240">(May 29 2021 at 14:37)</a>:</h4>
<p>At some point, I erwrote the implementation to be based on some initial work by <span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="240705245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705245">(May 29 2021 at 14:37)</a>:</h4>
<p>let me see if I can find it</p>



<a name="240705333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705333">(May 29 2021 at 14:39)</a>:</h4>
<p>actually, that's not quite right - pnkfelix's code still gathered up all of the future-incompat messages within rustc, but then emitted then one at a time at the end of compilation</p>



<a name="240705380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705380">(May 29 2021 at 14:40)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> can you elaborate on how that would simplify the json interface?</p>



<a name="240705976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240705976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240705976">(May 29 2021 at 14:55)</a>:</h4>
<p>Instead of defining a new top-level output structure, it can just be a new field of the diagnostic.  The difference woud be the documentation looking like this:</p>
<div class="codehilite" data-code-language="JavaScript"><pre><span></span><code><span class="cm">/* Here's another thing the compiler can output. */</span>
<span class="p">{</span>
    <span class="cm">/* An array of future incompatible warnings. */</span>
    <span class="s2">"future_incompat_report"</span><span class="o">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="cm">/* An optional date when this warning will become an error. */</span>
            <span class="s2">"future_breakage_date"</span><span class="o">:</span> <span class="s2">"2049-01-01"</span><span class="p">,</span>
            <span class="cm">/* The same diagnostic structure described above. */</span>
            <span class="s2">"diagnostic"</span><span class="o">:</span> <span class="p">{</span>
                <span class="cm">/*...*/</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</code></pre></div>
<p>Instead, it would be a new field in diagnostic:</p>
<div class="codehilite" data-code-language="JavaScript"><pre><span></span><code>    <span class="cm">/* An optional field that indicates this diagnostic may become an error in the future .*/</span>
    <span class="s2">"future_incompat"</span><span class="o">:</span> <span class="p">{</span>
        <span class="cm">/* An optional date when this warning will become an error. */</span>
        <span class="s2">"future_breakage_date"</span><span class="o">:</span> <span class="s2">"2049-01-01"</span>
    <span class="p">}</span>
</code></pre></div>
<p>This way, parsers won't need to define a new structure and look for it. They will only need to add a new field to the existing Diagnostic struct. If the tool doesn't know about that new field, it will just treat it like a normal warning. If it is a new top-level structure, tools may ignore it (or worse, choke on it). </p>
<p>It is not an important change, but just an idea to simplify a little.</p>



<a name="240706191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240706191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240706191">(May 29 2021 at 15:00)</a>:</h4>
<p>I don't have a strong opinion either way - my main concern would be that it would complicate some of the code on the cargo side</p>



<a name="240706745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240706745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240706745">(May 29 2021 at 15:14)</a>:</h4>
<p>I think the cargo side would be nearly identical. It would just detect the "future_incompat" field and if it is detected call <code>state.future_incompat_report</code> to stuff the message inside the <code>per_crate_future_incompat_reports</code>.</p>



<a name="240708011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/future%20incompat%20report/near/240708011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/future.20incompat.20report.html#240708011">(May 29 2021 at 15:47)</a>:</h4>
<p>sounds good to me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>